<!doctype html>
<html>
<head>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
		<script type="text/javascript" src="jquery-1.2.1.pack.js"></script>
		<script type="text/javascript" src="dump.js"></script>
		<script type="text/javascript" src="jsonsql-0.1.js"></script>
		<script type="text/javascript">
			function getAll(){
				$.getJSON("testjson.js", function(json){
					var str = jsonsql.query("select * from json.data.items order by FirstLetter asc limit 1,2",json);
					for(var i=0;i<str.length;i++)
					{
						alert(str[i].FullName);
					}
					alert(JSON.stringify(str));
					
					
				});
			}

           function getFiltered(){
				$.getJSON("testjson.js", function(json){
					dump(jsonsql.query("select title,url,author,category from json.channel.items where (category=='javascript' || author=='trent') order by title,category asc limit 3",json));
				});
			}

			function getLimit(){
				$.getJSON("testjson.js", function(json){
					dump(jsonsql.query("select url from json.channel.items where (category=='javascript' && author=='trent') order by url asc limit 1,2",json));
				});
			}
		</script>
 </HEAD>
 <BODY>	
		<p><b>ÔËÐÐÊ¾Àý£º</b></p>
		<hr/>
		<p>Óï¾ä1£º jsonsql.query("select * from json.channel.items order by title desc",json);</p>
        <button name="btn1" id="btn1"  onclick="getAll();">获取所有</button>
		<hr/>
		<p>Óï¾ä2£º jsonsql.query("select title,url from json.channel.items where (category=='javascript' || category=='vista') order by title,category asc limit 3",json);
		</p>
		<button name="btn2" id="btn2" onclick="getFiltered();">»ñÈ¡¹ýÂËÊý¾Ý</button>
		<hr/>
		<p>Óï¾ä3£ºjsonsql.query("select url from json.channel.items where (category=='javascript' && author=='trent') order by url asc limit 1,2",json);
		</p>
		<button name="btn3" id="btn3"  onclick="getLimit();">»ñÈ¡ÏÞ¶¨ÊýÁ¿µÄÊý¾Ý</button>
		<hr/>
		<p><b>²ÎÊýÏê½â£º</b></p>
		<p>Ö»Ö§³Ö Select ²éÑ¯Óï¾ä£¬¡°JSON¡±£º¡°json.channel.items¡±Ö¸ÏòÒ»¸ö¶ÔÏóÊý×é,
		ÅÅÐò½ÓÊÜ²ÎÊý£ºasc,desc,ascnum,descnum£¬
		limit£º½ÓÊÜ1£¬»ò2¸ö²ÎÊý£¬Ö¸¶¨Òª»ñÈ¡Êý¾ÝÊýÁ¿¸öÊý¡£
		</P>
		<pre>
		µ÷ÓÃJS·½·¨:

			function getAll(){
				$.getJSON("testjson.js", function(json){
					dump(jsonsql.query("select * from json.channel.items order by title desc,json",json));
				});
			}

			function getFiltered(){
				$.getJSON("testjson.js", function(json){
					dump(jsonsql.query("select title,url,author,category from json.channel.items where (category=='javascript' || author=='trent') order by title,category asc limit 3",json));
				});
			}

			function getLimit(){
				$.getJSON("testjson.js", function(json){
					dump(jsonsql.query("select url from json.channel.items where (category=='javascript' && author=='trent') order by url asc limit 1,2",json));
				});
			}
		
		µ÷ÓÃÍâ²¿JSÎÄ¼þ£º
		<\script type="text/javascript" src="jquery-1.2.1.pack.js"><\/script>
		<\script type="text/javascript" src="dump.js"><\/script>:Êä³öÎÄ¼þÑùÊ½ÎÄ¼þ
		<\script type="text/javascript" src="jsonsql-0.1.js"><\/script>
		</pre>
		
		<p>È¡µÃÊý¾ÝÐ§¹ûÍ¼£º</p>
 </BODY>
</HTML>
